<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Person {
            constructor(name,age) {
                this.name = name
                this.age = age
            }
            sayName() {
                console.log(this.name);
            }
        }
        var p = new Person('李四',20)

        // Student 加一个skill
        class Student{
           constructor(name, age,skill) {
                this.name = name
                this.age = age
                this.skill = skill
            }
            sayName() {
                console.log(this.name);
            }
        }
        // 没有extends关键字：出现大量重复代码，代码冗余。不符合编程初衷。
    </script>
</body>
</html>